﻿using System;
using System.Collections;
using System.Collections.Generic;
using Dragon.Library.Framework.Entity.Search.Page;
using Dragon.Library.Framework.Entity.Search.Query;

namespace Dragon.Library.Framework.Interface.Dao
{
    public interface IBaseDao<T, in TKey> : IDisposable where T : class,new()
    {

        bool IsOpen { get; }
        string SessionKey { get; set; }
        bool IsTran { get; set; }

        void Initialization(string sessionKey);

        object Create(T bean);

        bool Update(T bean);

        bool Delete(T bean);

        T GetObjectByKey(TKey id);

        PageResult<T> GetPageList(PageSearch pageSearch, QueryLevel queryLevel);
        PageResult<T> GetPageList(PageSearchString pageSearch);

        IList<T> Select(QueryGroup queryGroup, QueryLevel queryLevel);
        IList<T> Select(QueryString queryString);
        IList SelectList(QueryString queryString);

        IList ExecProcedure(string procedureName, Dictionary<string, object> parameter);

        void Flush();

        void ConnectionOpen();

        void ConnectionClose();

        void Clear();


    }
}
